import 'package:flutter/material.dart';

void main() => runApp(RouteTestPage());

class RouteTestPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'xixi',
      home: FirstScreen()
    );
  }
}

class FirstScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return RaisedButton(
      child: Text('第一页'),
      onPressed: () => Navigator.push(context, MaterialPageRoute(builder: (context) => SecondScreen())),
    );
  }
}

class SecondScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return RaisedButton(
      child: Text('第二页'),
      onPressed: () => Navigator.pop(context),
    );
  }
}